#pragma once 
#include<iostream>
#include<vector>
#include<string>
using namespace std;
#define INITMONEY 500
//商城
class SuMa
{
    public:
    //商城初始化
        SuMa()
        {
            maket.push_back("水银鞋,500");
            maket.push_back("攻速鞋,500");
            maket.push_back("铁板鞋,500");
            maket.push_back("日炎斗篷,3000");
            maket.push_back("血手,3000");
            maket.push_back("狂徒,2900");
            maket.push_back("绿甲,3000");
            maket.push_back("黑切,3300");
            maket.push_back("无尽,3300");
            maket.push_back("血刀,3300");
            maket.push_back("赛瑞尔达,3000");
            price.push_back(500);
            price.push_back(500);
            price.push_back(500);
            price.push_back(3000);
            price.push_back(3000);
            price.push_back(2900);
            price.push_back(3000);
            price.push_back(3300);
            price.push_back(3300);
            price.push_back(3000);
        }
        //购买装备
        void Buy(int& money)
        {
            //显示自己的金币数
            cout<<"金币："<<money<<endl;
            //显示所有装备
            for(const auto& e : maket)
                cout<<e<<endl;
            //购买规则
            int i=0;
            while(1)
            {
                cout<<"请输入你要购买的装备序号"<<endl;
                cin>>i;
                if(i >= 0 && i < 10)
                {
                    money-=price[i];
                    cout<<"购买成功"<<endl;
                    break;
                }
                else if(i==0)
                    break;
                else
                    continue;
            }
        }
    public:
        //装备
        vector<string> maket;
        //装备价钱
        vector<int> price;
};































//英雄特性
class Hero
{
    public:
        explicit Hero()
            :money(INITMONEY)
            ,Blue(0)
            ,Blood(0)
            ,Shield(0)
        {}
        
        virtual ~Hero()
        {
            Blood=Shield=0;
        }
        //代表人物
        virtual void people()=0;
        //购买装备
        virtual void Buyo()=0;
        //使用技能
        virtual void attack()=0;
        //剩余血量或者蓝量值计算
        virtual void remainder()=0;
        //金币变化量
        virtual void variation()=0;
        //查看人物的装备有哪些
        virtual void see()=0;
        //显示战绩
        virtual void record()=0;
    protected:
        //金币
        int money;
        //血量
        int Blood;
        //蓝
        int Blue;
        //护甲
        int Shield;
        //普通攻击
        int NormalAttack;
        //技能
        vector<string> Skill;
        //装备
        vector<string> outfit;
        //购买装备
        SuMa By;
};
class Ys : public Hero , public SuMa
{
    public:
        //代表人物
        virtual void people()
        {
            cout<<"死亡如风，常伴吾身"<<endl;
            cout<<money<<endl;
            Blood=700;
            Blue=0;
            Shield=200;
            NormalAttack=400;
            cout<<"血量："<<Blood<<"蓝："<<Blue<<"护甲："<<Shield<<"普攻："<<NormalAttack<<endl;
            Skill.push_back("空技能");
            Skill.push_back("技能一");
            Skill.push_back("技能二");
            Skill.push_back("技能三");
            Skill.push_back("大招");
            Skill.push_back("0")
            Skill.push_back("100");
            Skill.push_back("100");
            Skill.push_back("200");
            Skill.push_back("300");
            cout<<"人物技能分别是："<<endl;
            for(const auto& e : Skill)
                cout<<e<<",";
            cout<<endl;
        }
        //购买装备
        virtual void Buyo()
        {
            //商城的装备以及价钱
            SuMa::Buy(money);
        }
        //使用技能
        virtual void attack()
        {
            int i=0;
            cout<<"请输入你要选的技能序号(如果是普攻，请输入0)："<<endl;
            cin >> i;
            if(i == 0)
                cout<<"输出伤害值："<<NormalAttack<<endl;
            else
                cout<<"输出伤害值："<<Skill[i]<<endl;
        }
        //剩余血量或者蓝量值计算
        virtual void remainder(const Hero& x)
        {
            //受到伤害数组
            vector<int> v;
            v.push_back(x.NormalAttack);
            v.push_back(x.Skill[6]-'0');
            v.push_back(x.Skill[7]-'0');
            v.push_back(x.Skill[8]-'0');
        }
};
